Display error message.

<div class="definition">
    error(msg)
</div>

<div class="arguments">
    <table>
    <tr>
        <td>msg</td>
        <td><b>string</b>, error message</td>
    </tr>
    </table>
</div>
Returns <i>undefined</i>.

<h4>Description</h4>

This method displays the error message and emits <a class="method" href="w2form.onError">.onError</a> event.
<div style="height: 10px"></div>

If you have following form:
<textarea class="javascript">
let form = new w2form({
    name     : 'form',
    formURL  : '/server/path',
    fields: [
        { field: 'first_name', type: 'text', required: true },
        { field: 'last_name', type: 'text', required: true },
        { field: 'email', type: 'email' }
    ]
});
</textarea>

You can
<textarea class="javascript">
w2ui.form.error('Some error.');
</textarea>